/*
 * MIT License
 * Copyright (c) 2017 - 2022 _VIFEXTech
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */
#include "Arduino.h"

__attribute__((weak)) void pinMode(uint32_t pin, uint32_t mode) {


}

__attribute__((weak)) void digitalWrite(uint32_t pin, uint8_t val) {

}

__attribute__((weak)) int digitalRead(uint32_t pin) {
    return 0;
}

uint32_t pulseIn(uint8_t pin, uint8_t state, uint32_t timeout) {
    return 0;
}

/**
 * \brief 将一个数字(整形)从一个范围重新映射到另一个区域
 * \param x 要映射的数字
 * \param in_min 值的当前范围的下界
 * \param in_max 值的当前范围的上界
 * \param out_min 值的目标范围的下界
 * \param out_max 值目标范围的上界
 * \return 映射的值(long)
 */
long map(long x, long in_min, long in_max, long out_min, long out_max) {
    return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}

void yield(void) {
}


